home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / etc / kde4 / kdm / Xsession < prev    next >
Encoding:
Text File  |  2008-10-24  |  1.4 KB  |  47 lines

  1. #! /bin/sh
  2. # Xsession - run as user
  3.  
  4. session=$1
  5.  
  6. # Note that the respective logout scripts are not sourced.
  7. case $SHELL in
  8.   */bash)
  9.     [ -z "$BASH" ] && exec $SHELL $0 "$@"
  10.     set +o posix
  11.     [ -f /etc/profile ] && . /etc/profile
  12.     if [ -f $HOME/.bash_profile ]; then
  13.       . $HOME/.bash_profile
  14.     elif [ -f $HOME/.bash_login ]; then
  15.       . $HOME/.bash_login
  16.     elif [ -f $HOME/.profile ]; then
  17.       . $HOME/.profile
  18.     fi
  19.     ;;
  20.   */zsh)
  21.     [ -z "$ZSH_NAME" ] && exec $SHELL $0 "$@"
  22.     emulate -R zsh
  23.     [ -d /etc/zsh ] && zdir=/etc/zsh || zdir=/etc
  24.     zhome=${ZDOTDIR:-$HOME}
  25.     # zshenv is always sourced automatically.
  26.     [ -f $zdir/zprofile ] && . $zdir/zprofile
  27.     [ -f $zhome/.zprofile ] && . $zhome/.zprofile
  28.     [ -f $zdir/zlogin ] && . $zdir/zlogin
  29.     [ -f $zhome/.zlogin ] && . $zhome/.zlogin
  30.     setopt shwordsplit noextendedglob
  31.     ;;
  32.   */csh|*/tcsh)
  33.     # [t]cshrc is always sourced automatically.
  34.     # Note that sourcing csh.login after .cshrc is non-standard.
  35.     xsess_tmp=`mktemp /tmp/xsess-env-XXXXXX`
  36.     $SHELL -c "if (-f /etc/csh.login) source /etc/csh.login; if (-f ~/.login) source ~/.login; /bin/sh -c export -p >! $xsess_tmp"
  37.     . $xsess_tmp
  38.     rm -f $xsess_tmp
  39.     ;;
  40.   *) # Plain sh, ksh, and anything we do not know.
  41.     [ -f /etc/profile ] && . /etc/profile
  42.     [ -f $HOME/.profile ] && . $HOME/.profile
  43.     ;;
  44. esac
  45. # invoke global X session script
  46. . /etc/X11/Xsession
  47.